package com.yueka.service.Impl;

import com.yueka.mapper.ExperienceMapper;
import com.yueka.pojo.entity.experience.Experience;
import com.yueka.service.ExperienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class ExperienceServiceImpl implements ExperienceService {

    @Autowired
    private ExperienceMapper experienceMapper;
    @Override
    public List<Experience> list() {
        return experienceMapper.list();
    }

    @Override
    public void insert(Experience experience) {
        experience.setCreateTime(LocalDateTime.now());
        experience.setUpdateTime(LocalDateTime.now());
        experienceMapper.insert(experience);
    }

    @Override
    public void update(Experience experience) {
        experienceMapper.update(experience);
    }

    @Override
    public void delete(Integer id) {
        experienceMapper.delete(id);
    }
}
